﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Security;
using System.Text;
using System.Threading.Tasks;

namespace ZGRemote.Server.UI
{
    internal static class SettingConfig
    {
        public static byte[] RSACSPBLOB
        {
            get
            { 
                return Convert.FromBase64String(Settings.RsaCspBlob); 
            }
            set
            {
                Settings.RsaCspBlob = Convert.ToBase64String(value);
                Settings.Save();
            }
        }

        public static string PROGRAM_FILE_NAME;

        public static string PROGRAM_DIRECTORY;

        public static Properties.Settings Settings => Properties.Settings.Default;

        static SettingConfig()
        {
            PROGRAM_FILE_NAME = Process.GetCurrentProcess().MainModule!.FileName;
            PROGRAM_DIRECTORY = Path.GetDirectoryName(PROGRAM_FILE_NAME)!;
        }
    }
}
